package com.yoomiito.app.ui.order.detail;

import androidx.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yoomiito.app.R;
import com.yoomiito.app.model.order.ItemInfo;

import java.util.List;

public class ItemInfoAdapter extends BaseQuickAdapter<ItemInfo, BaseViewHolder> {

    public ItemInfoAdapter(@Nullable List<ItemInfo> data) {
        super(R.layout.item_info,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ItemInfo item) {
        TextView keyTv = helper.getView(R.id.key);
        keyTv.setText(item.getKey());
        TextView valueTv = helper.getView(R.id.value);
        valueTv.setText(item.getValue());
        if (item.isBold()){
            keyTv.getPaint().setFakeBoldText(true);
            valueTv.getPaint().setFakeBoldText(true);
        }
    }
}
